package com.come4loves.game.module.skill.targetimpl;

import java.util.ArrayList;
import java.util.Collection;

import org.springframework.stereotype.Component;

import com.come4loves.game.module.card.constant.CardType;
import com.come4loves.game.module.fight.model.FightCard;
import com.come4loves.game.module.skill.AbstractTargetCards;
@Component
public class TargetUnitCards extends AbstractTargetCards {

	@Override
	public Collection<FightCard> getTargets(Collection<FightCard> cards, int race, int randomNum) {
		Collection<FightCard> result = new ArrayList<FightCard>();
		for (FightCard card : cards) {
			if (card.getCardType().equals(CardType.UNIT)){
				result.add(card);
			}
		}
		if (race >= 0) {
			result = filterRace(result, race);
		}
		return result;
	}
	@Override
	public int id() {
		return 2;
	}

}
